package cn.madis.ymcc.web.controller;

import cn.madis.ymcc.dto.AlipayNotifyDto;
import cn.madis.ymcc.service.IPayNotifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;


@RestController
@RequestMapping("/pay")
public class PayNotifyController {
    @Autowired
    private IPayNotifyService payNotifyService;
    /**
     * 支付宝最大努力通知
     */
    @RequestMapping(value = "/alipay/notify",method = RequestMethod.POST)
    public String notify(AlipayNotifyDto dto){

        try {
           return payNotifyService.notify(dto);
        } catch (Exception e) {
            e.printStackTrace();
            return "ERROR";//要再次通知我
        }

        //success//不要再通知我了
    }
}
